package com.xingkeduo.business.order.remote.feign;

import com.xingkeduo.pojo.table.Comments;
import com.xingkeduo.utils.ResponseUtils;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.time.LocalDateTime;
import java.util.Map;
import java.util.Set;

@FeignClient(value = "business-comments",   fallback = CommentFeignServiceImpl.class)
public interface CommentFeignService {


    //查询订单的评论
    @RequestMapping("/api/comments/detail/{orderId}")
    ResponseUtils<Comments> queryDetailByorderId(@PathVariable("orderId") long orderId);

    // 查询指定日期的评论与差评数
    @RequestMapping("/api/comments/service/{storeId}/{startTime}/{endTime}")
    ResponseUtils<Map<String, Integer>> queryServiceQuality(@PathVariable("storeId") String storeId, @PathVariable("startTime") LocalDateTime startTime, @PathVariable("endTime") LocalDateTime endTime);

    // 服务质量详情
    @RequestMapping("/api/comments/details/service/{storeId}/{startTime}/{endTime}")
    ResponseUtils<Set<String>> queryDetailsServiceQuality(@PathVariable("storeId") String storeId, @PathVariable("startTime") LocalDateTime startTime, @PathVariable("endTime") LocalDateTime endTime);

    // 发型师质量详情
    @RequestMapping("/api/comments/adminId/service/{storeId}/{adminId}/{startTime}/{endTime}")
    ResponseUtils<Map<String, Integer>> queryDetailsServiceQualityByAdminId(@PathVariable("storeId") String storeId, @PathVariable("adminId")String adminId, @PathVariable("startTime") LocalDateTime startTime, @PathVariable("endTime") LocalDateTime endTime);

    /**
    * @description: 修改评论状态
    * @author: ch
    * @Param [orderNo]
    * @return com.xingkeduo.utils.ResponseUtils
    * @date: 2019-08-06 18:56
    **/
    @PutMapping("/api/comments/aftermarket")
    ResponseUtils aftermarket(@RequestParam(value="orderNo") String  orderNo);
}
